package org.redis.cluster.test.transport.netty;

import org.redis.cluster.test.transport.ProtocolCommand;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

public class NettyHandler extends SimpleChannelInboundHandler<Object> {

	@Override
	protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
		if(!(msg instanceof ProtocolCommand)) {
			return;
		}
		
		ProtocolCommand command=(ProtocolCommand)msg;
		System.out.println(new String(command.getContent()[0]));
	}

}